<!DOCTYPE html>
<!--suppress ThymeleafVariablesResolveInspection -->
<html lang="en" xmlns:th="http://www.thymeleaf.org/">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>天天生鲜-用户中心</title>
	<div th:replace="header::common_resource"></div>
</head>
<body>
	<div th:replace="top::top"></div>

	<div class="main_con clearfix">
		<div class="left_menu_con clearfix">
			<h3>用户中心</h3>
			<ul>
				<li><a href="/user/getUserCenterPage">· 个人信息</a></li>
				<li><a href="/order/getOrderListPage">· 全部订单</a></li>
				<li><a href="/user/getAddressListPage" class="active">· 收货地址</a></li>
				<li><a href="/user/getUserUpdatePage">· 修改个人信息</a></li>
			</ul>
		</div>
		<div class="right_content clearfix">
				<h3 class="common_title2">收货地址</h3>
				<div class="site_con">
					<dl>
						<dt>当前地址：</dt>
						<th:block th:each="shipping:${list}">
							<dd>
								<span th:text="${shipping.receiverProvince}"></span>
								<span th:text="${shipping.receiverCity}"></span>
								<span th:text="${shipping.receiverDistrict}"></span>
								<span th:text="${shipping.receiverAddress}"></span>
								<span th:text="|${shipping.receiverName} 收|"></span>
								<span th:text="|联系方式${shipping.receiverPhone}|"></span>
							</dd>
						</th:block>
					</dl>					
				</div>
				<h3 class="common_title2">编辑地址</h3>
				<div class="site_con">
					<form id="formId">
						<input th:value="${session.user.id}" name="userId" type="hidden">
						<div class="form_group">
							<label>收件人：</label>
							<input type="text" name="receiverName">
						</div>
						<div class="form_group">
							<label>省份：</label>
							<input type="text" name="receiverProvince">
						</div>
						<div class="form_group">
							<label>市：</label>
							<input type="text" name="receiverCity">
						</div>
						<div class="form_group">
							<label>区：</label>
							<input type="text" name="receiverDistrict">
						</div>
						<div class="form_group form_group2">
							<label>地址：</label>
							<input class="site_area" name="receiverAddress">
						</div>
						<div class="form_group">
							<label>电话：</label>
							<input type="text" name="receiverPhone">
						</div>

						<input type="button" name="" value="提交" class="info_submit" onclick="submitForm()">
					</form>
				</div>
		</div>
	</div>



	<div class="footer">
		<div class="foot_link">
			<a href="#">关于我们</a>
			<span>|</span>
			<a href="#">联系我们</a>
			<span>|</span>
			<a href="#">招聘人才</a>
			<span>|</span>
			<a href="#">友情链接</a>		
		</div>
		<p>CopyRight © 2016 北京天天生鲜信息技术有限公司 All Rights Reserved</p>
		<p>电话：010-****888    京ICP备*******8号</p>
	</div>

	<script>
		submitForm = function () {
			$.post(
				'/shipping/insert',
				$('#formId').serialize(),
				function (result) {
					if (result.ok) {
						mylayer.okMsg(result.msg);
						window.location.reload();
					} else {
						mylayer.errorMsg(result.msg);
					}
				}
			);
		}
	</script>
	
</body>
</html>